﻿/*---------------------------------------------------------------------*/
// fileName="DataAccessIOC.cs" CompanyName="SureKAM"
// Copyright SureKAM (c). All right reserved.
/*---------------------------------------------------------------------*/

namespace SureKAM.BackUp.Notify.DataAccess
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.Practices.Unity;
    using SureKAM.BackUp.Notify.DataAccess.implement;

    /// <summary>
    /// 提供DataAccessIOC 容器
    /// </summary>
    public class DataAccessIOC
    {
        private static IUnityContainer current;
        public  static  IUnityContainer Current
        {
            get
            {
                if(current==null)
                {
                    current=new UnityContainer();
                    current.RegisterType<IDirectory,DirectoryRes>(new ContainerControlledLifetimeManager());
                    current.RegisterType<INotify, NotifyRes>(new ContainerControlledLifetimeManager());
                    current.RegisterType<IDNMapping,DNMappingRes>(new ContainerControlledLifetimeManager());
                }
                return current;
            }
        }
    }
}
